onFailureSuspend

inline suspend fun <T> Result<T>.onFailureSuspend(crossinline action: suspend (exception: Throwable) -> Unit): Result<T>

Executes a suspend function action if the current result is a failure.

Return

The current Result instance.

Parameters

action

A suspend function to be executed if the result is a failure.